

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create MemberProfile</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
        </div>

        <div class="body">
            <h1>Invite personne to join the community</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${invitation}">
            <div class="errors">
                <g:renderErrors bean="${invitation}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="invitePerson" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>

                            <tr class="prop">
                                     <td valign="top" class="name">
                                         <label for="inviter">Invitation from:</label>
                                     </td>
                                     <td valign="top" class="value ${hasErrors(bean:invitation,field:'inviter','errors')}">
                                         <label> "${fieldValue(bean:invitation,field:'inviter')}"</label>
                                     </td>
                             </tr>

                             <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="invited">Person's email:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:invitation,field:'invited','errors')}">
                                    <input type="text" id="invited" name="invited" value="${fieldValue(bean:invitation,field:'invited')}"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="code">Invitation reference:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:invitation,field:'code','errors')}">
                                    %{--<input size="80" type="text" id="code" name="code" disabled="true" value="${invitation?.code?.encodeAsHTML()}"/>--}%
                                    <label>${invitation?.code?.encodeAsHTML()}</label>
                                    <input type="hidden" value="${invitation?.code?.encodeAsHTML()}" name="code"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="message">Message:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:invitation,field:'message','errors')}">
                                    <textarea rows="5" cols="80" size="300" name="message" disabled="true">${invitation?.message?.encodeAsHTML()}</textarea>
                                    <input type="hidden" name="message" value="${invitation?.message?.encodeAsHTML()}"/>
                                </td>
                            </tr> 
                        

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Send" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
